﻿import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { AppCommonModule } from '@app/shared/common/app-common.module';
import { UtilsModule } from '@shared/utils/utils.module';
import { CountoModule } from 'angular2-counto';
import { ModalModule, TabsModule, TooltipModule, BsDropdownModule } from 'ngx-bootstrap';
import { NgxChartsModule } from '@swimlane/ngx-charts';
import {
    BsDatepickerModule,
    BsDatepickerConfig,
    BsDaterangepickerConfig,
    BsLocaleService
} from 'ngx-bootstrap/datepicker';
import { NgxBootstrapDatePickerConfigService } from 'assets/ngx-bootstrap/ngx-bootstrap-datepicker-config.service';
import { CostImportRoutingModule } from './cost-import-routing.module';
import { TableModule } from 'primeng/table';
import { CalendarModule, PaginatorModule } from 'primeng/primeng';
import { YclCostImportComponent } from './direct-cost/ycl-cost.component';
import { ZzCostImportComponent } from './actual-cost/zz-cost.component';
import { RdCostImportComponent } from './actual-cost/rd-cost.component';
import { RgCostImportComponent } from './actual-cost/rg-cost.component';
import { ImportToExcelComponent } from './shared/import/import-to-excel.component';
import { ImportRecordModalComponent } from './shared/import/import-record-preview-modal.component';
import { BzjCostImportComponent } from './direct-cost/bzj-cost.component';
import { WxcpCostImportComponent } from './direct-cost/wxcp-cost.component';
import { QtCostImportComponent } from './direct-cost/qt-cost.component';
import { FzclCostImportComponent } from './actual-cost/fzcl-cost.component';

NgxBootstrapDatePickerConfigService.registerNgxBootstrapDatePickerLocales();

@NgModule({
    imports: [
        CommonModule,
        FormsModule,
        ModalModule,
        TabsModule,
        TooltipModule,
        AppCommonModule,
        UtilsModule,
        CountoModule,
        TableModule,
        CalendarModule,
        NgxChartsModule,
        CostImportRoutingModule,
        BsDatepickerModule.forRoot(),
        BsDropdownModule.forRoot(),
        PaginatorModule
    ],
    declarations: [
        ImportToExcelComponent,
        ZzCostImportComponent,
        YclCostImportComponent,
        RdCostImportComponent,
        RgCostImportComponent,
        BzjCostImportComponent,
        WxcpCostImportComponent,
        ImportRecordModalComponent,
        QtCostImportComponent,
        FzclCostImportComponent
    ],
    providers: [
        {
            provide: BsDatepickerConfig,
            useFactory: NgxBootstrapDatePickerConfigService.getDatepickerConfig
        },
        {
            provide: BsDaterangepickerConfig,
            useFactory: NgxBootstrapDatePickerConfigService.getDaterangepickerConfig
        },
        {
            provide: BsLocaleService,
            useFactory: NgxBootstrapDatePickerConfigService.getDatepickerLocale
        }
    ]
})
export class CostImportModule {}
